<?php
class Suppliers_model extends CI_Model {
	public function __construct() {
		parent :: __construct();
	}

	public function count_nums(){ /*取得总行数*/
		return $this->db->count_all('suppliers');
	}

	public function list_suppliers($limit,$offset = 0){ /*获取分页customer数据*/
		$this->db->limit($limit,$offset);
		$this->db->select('suppliers.*,region.district')->from('suppliers')->join('region', 'suppliers.region_id = region.id')->order_by("suppliers.outside_contract_nums", "desc");
		$query = $this->db->get();
		
		return $query->result();
	}
}
